package router

import (
	"gitee.com/tang_q/gin-vue3-admin-api/api"
	"github.com/gin-gonic/gin"
)

func RoleRoute() {
	RegisterRoute(func(rgPublic *gin.RouterGroup, rgAuth *gin.RouterGroup) {
		menuApi := api.NewRoleApi()
		//rgPublicRole := rgPublic.Group("role").Use(func() gin.HandlerFunc {
		//	return func(c *gin.Context) {
		//		// 这里写公共接口的中间件
		//	}
		//}())
		//{
		//	 // 公开接口
		//}
		rgAuthRole := rgAuth.Group("role")
		{
			rgAuthRole.POST("/getRoleList", menuApi.GetRoleList)
			rgAuthRole.GET("/getRoleByID", menuApi.GetRoleByID)
			rgAuthRole.POST("/createRole", menuApi.CreateRole)
			rgAuthRole.POST("/updateRole", menuApi.UpdateRole)
			rgAuthRole.DELETE("/deleteRole", menuApi.DeleteRole)
			rgAuthRole.DELETE("/deleteRoles", menuApi.DeleteRoles)
		}
	})
}
